import request from '@/utils/request'

export function getproperties() {
  return request({
    url: '/properties'
  })
}

export function getproperty(id) {
  return request({
    url: '/properties/' + id
  })
}

export function delProperty(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}

export function addProperty(data) {
  return request({
    url: `/properties`,
    method: 'post',
    data
  })
}

export const editProperty = (id, data) => request({
  url: '/properties/' + id,
  method: 'PUT',
  data
})

export const getCategories = () => request({
  url: '/categories'
})

export const getPgProperties = (params) => request({
  url: '/properties',
  params
})
